#!/bin/bash
set -e

while getopts  ":p:" opts
do
        case  $opts  in
		p) out_prefix=$OPTARG;;
		\?)
			echo `basename $0` '[-p out_prefix] <in.bam>'
			exit 1
			;;
        esac
done
shift $(($OPTIND - 1))


if [ $# -lt 1 ]; then
        echo `basename $0` '[-p out_prefix] <in.bam>'
        exit 1
fi

#-----------------------------------------------
. /mnt/ilustre/app/medical/tools/.var #---------
#-----------------------------------------------

test -s $out_prefix.seq.DupRate.xls -a -s $out_prefix.pos.DupRate.xls || read_duplication.py -i $1 -o $out_prefix

Rscript $tools_path/script/duprate1.r $out_prefix.pos.DupRate.xls $out_prefix.seq.DupRate.xls $out_prefix



